package com.gitee.wsl.ext.map.bikey

import com.gitee.wsl.collections.map.bikey.BiKey
import com.gitee.wsl.collections.map.bikey.invoke
import com.gitee.wsl.ext.map.getOrDefault
import com.gitee.wsl.ext.map.putIfAbsent

fun <R, C, V> MutableMap<BiKey<R, C>,V>.put(row : R, column : C, value : V) = put(BiKey(row, column),value)

fun <R, C, V> MutableMap<BiKey<R, C>,V>.putIfAbsent(row : R, column : C, value : V) = this.putIfAbsent(
    BiKey(
        row,
        column
    ),value)

fun <R, C, V> Map<BiKey<R, C>,V>.get(row : R, column : C) = get(BiKey(row, column))

fun <R, C, V> Map<BiKey<R, C>,V>.getOrDefault(row : R, column : C, default:V) = this.getOrDefault(BiKey(row, column),default)


fun <R, C, V> MutableMap<BiKey<R, C>,V>.remove(row : R, column : C) = remove(BiKey(row, column))

fun <R, C, V> Map<BiKey<R, C>,V>.containsKey(row : R, column : C) = containsKey(BiKey(row, column))

